#include <stdio.h>
#include <string.h>
#include "testexec.h"

void CExec::canvassize (double x, double y)
{
   printf ("Set Canvas Size %g, %g.\n", x, y);
}

void CExec::CExec::reset (void)
{
   printf ("Reset.\n");
}

void CExec::clear (void)
{
   printf ("Clear.\n");
}

void CExec::hide (void)
{
   printf ("Hide turtle.\n");
}

void CExec::canvascolor (double r, double g, double b)
{
   printf ("Set Canvas Color. R,G,B: %g, %g, %g.\n", r, g, b);
}

void CExec::pencolor (double r, double g, double b)
{
   printf ("Set Pen Color. R,G,B: %g, %g, %g.\n", r, g, b);
}

void CExec::penwidth (double d)
{
   printf ("Set pen width as %g.\n", d);
}

void CExec::go (double x, double y)
{
   printf ("Go %g, %g.\n", x, y);
}

void CExec::direction (double d)
{
   printf ("Direction %g.\n", d);
}

void CExec::turnright (double d)
{
   printf ("Turn Right %g degree.\n", d);
}

void CExec::turnleft (double d)
{
   printf ("Turn Left %g degree.\n", d);
}

void CExec::forward (double d)
{
   printf ("Forward %g.\n", d);
}

void CExec::backward (double d)
{
   printf ("Backward %g.\n", d);
}

void CExec::fontsize (double d)
{
   printf ("Set Fontsize as %g.\n", d);
}

void CExec::print (char* str)
{
   printf ("PRINT --- %s .\n", str);
}

void CExec::penup (void)
{
   printf ("Pen Up.\n");
}

void CExec::pendown (void)
{
   printf ("Pen Down.\n");
}

void CExec::center (void)
{
   printf ("Move to center.\n");
}

void CExec::gox (double d)
{
   printf ("Gox %g.\n", d);
}

void CExec::goy (double d)
{
   printf ("Goy %g.\n", d);
}

void CExec::wrapon (void)
{
   printf ("Warp on.\n");
}

void CExec::wrapoff (void)
{
   printf ("Warp off.\n");
}


void CExec::show (void)
{
   printf ("Show turtle.\n");
}

#define BUF_SIZE 256

char* CExec::inputwindow(char* str)
{
   static char buf[INPUT_SIZE];
   int len;

   printf ("... Input %s:", str);
   fgets (buf, INPUT_SIZE, stdin);
   len = strlen (buf);

   if (len == 0) {
      return buf;
   }
   if (buf[len-1] == 0x0A || buf[len-1] == 0x0D) {
      buf[len-1] = '\0';
   }
   return buf;
}

void CExec::message (char* txt)
{
   printf ("Message: %s\n", txt);
}

void CExec::debug_info (char* txt)
{
   printf ("%s", txt);
}

void CExec::error_info (char* txt)
{
   printf ("%s", txt);
}

